package educar.gui;
import java.awt.event.ActionListener;

import javax.swing.JOptionPane;
import educar.controllers.ComboAbmController;
import educar.controllers.ModificarComboController;
import educar.controllers.ComboAbmControllerB;
import educar.gui.ComboAbmView;
import educar.controllers.ActividadControllerAlum;
import educar.controllers.IController;

public class Abm extends javax.swing.JFrame implements IView {

    /** Creates new form Abm */
    public Abm() {
        initComponents();
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">
    private void initComponents() {

        jLabel1 = new javax.swing.JLabel();
        jButton1 = new javax.swing.JButton();
        jButton2 = new javax.swing.JButton();
        jButton3 = new javax.swing.JButton();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);

        jLabel1.setFont(new java.awt.Font("DejaVu Sans", 1, 14)); // NOI18N
        jLabel1.setText("ABM");
        jLabel1.setCursor(new java.awt.Cursor(java.awt.Cursor.DEFAULT_CURSOR));

        jButton1.setText("ALTA");

        jButton2.setText("BAJA");

        jButton3.setText("MODIFICACIÓN");

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addGroup(layout.createSequentialGroup()
                        .addGap(161, 161, 161)
                        .addComponent(jLabel1))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(150, 150, 150)
                        .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                            .addComponent(jButton2, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addComponent(jButton1, javax.swing.GroupLayout.Alignment.LEADING, javax.swing.GroupLayout.DEFAULT_SIZE, 79, Short.MAX_VALUE)))
                    .addGroup(layout.createSequentialGroup()
                        .addGap(139, 139, 139)
                        .addComponent(jButton3)))
                .addContainerGap(155, Short.MAX_VALUE))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jLabel1)
                .addGap(18, 18, 18)
                .addComponent(jButton1)
                .addGap(18, 18, 18)
                .addComponent(jButton2)
                .addGap(18, 18, 18)
                .addComponent(jButton3)
                .addContainerGap(30, Short.MAX_VALUE))
        );

        pack();
        
        LoginListener buttonListener2 = new LoginListener();
    	IController loginController2 = new ComboAbmController();
    	loginController2.setView(this);
    	buttonListener2.associate(jButton1, loginController2);
    	
    	LoginListener buttonListener3 = new LoginListener();
    	IController loginController3 = new ComboAbmControllerB();
    	loginController3.setView(this);
    	buttonListener3.associate(jButton2, loginController3);
    	
    	LoginListener buttonListener4 = new LoginListener();
    	IController loginController4 = new ModificarComboController();
    	loginController3.setView(this);
    	buttonListener4.associate(jButton3, loginController4);
        
    }// </editor-fold>

    /**
    * @param args the command line arguments
    */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new Abm().setVisible(true);
            }
        });
    }
    public void present(String model) {
		JOptionPane.showMessageDialog(null, model);
	}
    
    
    public void addActionListener(ActionListener lis){
		jButton1.addActionListener(lis);
		jButton2.addActionListener(lis);
		jButton3.addActionListener(lis);
    }
    
     // Variables declaration - do not modify
    private javax.swing.JButton jButton1;
    private javax.swing.JButton jButton2;
    private javax.swing.JButton jButton3;
    private javax.swing.JLabel jLabel1;
    // End of variables declaration
}
